package org.example.pojo;

import java.util.Arrays;

public class Classroom extends Building {
    private int roomno = 0;
    private String roomname = "";
    private boolean[] classNum = new boolean[35];
    private int hold = 0;
    private int roomtype = 0;

    public Classroom() { }

    public Classroom(int roomno, String roomname, boolean[] classNum, int hold, int roomtype) {
        this.roomno = roomno;
        this.roomname = roomname;
        this.classNum = classNum;
        this.hold = hold;
        this.roomtype = roomtype;
    }

    public Classroom(int buildingno, String buildingname, int roomno, String roomname, boolean[] classNum, int hold, int roomtype) {
        super(buildingno, buildingname);
        this.roomno = roomno;
        this.roomname = roomname;
        this.classNum = classNum;
        this.hold = hold;
        this.roomtype = roomtype;
    }

    public int getRoomno() {
        return roomno;
    }

    public void setRoomno(int roomno) {
        this.roomno = roomno;
    }

    public String getRoomname() {
        return roomname;
    }

    public void setRoomname(String roomname) {
        this.roomname = roomname;
    }

    public boolean getClassNum(int i) {
        return classNum[i];
    }//获取第i节是否上课

    public void setClassNum(int i,boolean b) {
        this.classNum[i] = b;
    }//设置第i节上课为b

    public void setClassNum(){
        for(int i=0;i<35;i++)
            classNum[i]=false;
    }//初始化所有时间没有上课

    public boolean[] getClassNum() {
        return classNum;
    }

    public void setClassNum(boolean[] classNum) {
        this.classNum = classNum;
    }

    public int getHold() {
        return hold;
    }

    public void setHold(int hold) {
        this.hold = hold;
    }

    public int getRoomtype() {
        return roomtype;
    }

    public void setRoomtype(int roomtype) {
        this.roomtype = roomtype;
    }

    @Override
    public String toString() {
        return "Classroom{" +
                "roomno=" + roomno +
                ", roomname='" + roomname + '\'' +
                ", classNum=" + Arrays.toString(classNum) +
                ", hold=" + hold +
                ", roomtype=" + roomtype +
                "} " + super.toString();
    }
}
